package com.ee.bruscar.mock.business;

import java.io.File;
import java.net.URL;
import java.util.List;

import com.ee.bruscar.Bruscar;
import com.ee.bruscar.mock.model.SimpleModel;
import com.ee.bruscar.mock.model.SimpleNestedModel;

public class SimpleDelegateStub implements SimpleDelegate
{
	Bruscar bruscar;
	
	public SimpleDelegateStub()
	{
		URL url = this.getClass().getResource("/");
		File file = new File( url.getPath() + "/SimpleDelegateBruscarConfig.xml" );
		bruscar = new Bruscar( file );
	}
	
	public String getString()
	{
		return  (String) bruscar.getStubDataFor("getString");
	}

	public SimpleModel getSimpleModel(String id)
	{
		return  (SimpleModel) bruscar.getStubDataFor("getSimpleModel");
	}

	public SimpleModel getUnhintedSimpleModel(String string)
	{
		return  (SimpleModel) bruscar.getStubDataFor("getUnhintedSimpleModel");
	}

	public SimpleModel getSimpleModelFromReference(String id)
	{
		return (SimpleModel) bruscar.getStubDataFor("getSimpleModelFromReference");
	}

	public SimpleNestedModel getSimpleNestedModelFromReference(String id)
	{
		return (SimpleNestedModel) bruscar.getStubDataFor("getSimpleNestedModelFromReference");
	}

	public SimpleNestedModel getUnhintedSimpleNestedModel(String id)
	{
		return (SimpleNestedModel) bruscar.getStubDataFor("getUnhintedSimpleNestedModel");
	}

	public SimpleNestedModel getSimpleNestedModelFromReferenceWithInlineHint( String id)
	{
		return (SimpleNestedModel) bruscar.getStubDataFor("getSimpleNestedModelFromReferenceWithInlineHint");
	}

	public SimpleNestedModel getSimpleNestedModelThatIsReferencedFromAModelHint(
			String string)
	{
		return (SimpleNestedModel) bruscar.getStubDataFor("getSimpleNestedModelThatIsReferencedFromAModelHint");
	}
	
	@SuppressWarnings("unchecked")
	public List<SimpleModel> getUnhintedSimpleModelList( String string)
	{
		return (List<SimpleModel>) bruscar.getStubDataFor("getUnhintedSimpleModelList");
	}

	@SuppressWarnings("unchecked")
	public List<SimpleModel> getHintedSimpleModelList(String string)
	{
		return (List<SimpleModel>) bruscar.getStubDataFor("getHintedSimpleModelList");
	}

}
